/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.awt.Toolkit;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Lenh Ho Xung
 */
public class FrameMenu extends javax.swing.JFrame {

    public static FrameMenu menu;

    /**
     * Creates new form FrameMenu
     */
    public FrameMenu() {
        initComponents();
        this.setSize(1050, 700);
        this.setLocation(200, 15);
        imageViewer.setImage(Toolkit.getDefaultToolkit().getImage("src/Image/hotel.jpg"));
        this.setIconImage(Toolkit.getDefaultToolkit().getImage("src/Image/trogiup.png"));

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        PannelTab = new javax.swing.JPanel();
        btDangNhap = new javax.swing.JButton();
        btNghiepVu = new javax.swing.JButton();
        btChatLuong = new javax.swing.JButton();
        btThongTin = new javax.swing.JButton();
        btTimKiem = new javax.swing.JButton();
        pannelDestop = new javax.swing.JDesktopPane();
        imageViewer = new org.jdesktop.swingx.JXImageView();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Quản Lý Khách Sạn");
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        PannelTab.setBackground(new java.awt.Color(102, 102, 102));
        PannelTab.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

        btDangNhap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/hethong.png"))); // NOI18N
        btDangNhap.setText("Đăng nhập");
        btDangNhap.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        btDangNhap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btDangNhapActionPerformed(evt);
            }
        });

        btNghiepVu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/thaydoiquydinh.png"))); // NOI18N
        btNghiepVu.setText("Quản lý");
        btNghiepVu.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        btNghiepVu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btNghiepVuActionPerformed(evt);
            }
        });

        btChatLuong.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/thuephong.png"))); // NOI18N
        btChatLuong.setText("Chất lượng");
        btChatLuong.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        btChatLuong.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btChatLuongActionPerformed(evt);
            }
        });

        btThongTin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/About-icon.png"))); // NOI18N
        btThongTin.setText("Thông tin");
        btThongTin.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        btThongTin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btThongTinActionPerformed(evt);
            }
        });

        btTimKiem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/tracuuphong.png"))); // NOI18N
        btTimKiem.setText("Tìm kiếm");
        btTimKiem.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        btTimKiem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTimKiemActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout PannelTabLayout = new javax.swing.GroupLayout(PannelTab);
        PannelTab.setLayout(PannelTabLayout);
        PannelTabLayout.setHorizontalGroup(
            PannelTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btNghiepVu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(btThongTin, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(btDangNhap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(btTimKiem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(btChatLuong, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        PannelTabLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btChatLuong, btNghiepVu, btThongTin});

        PannelTabLayout.setVerticalGroup(
            PannelTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PannelTabLayout.createSequentialGroup()
                .addGap(50, 50, 50)
                .addComponent(btDangNhap)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btNghiepVu)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btTimKiem)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btChatLuong)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btThongTin)
                .addGap(44, 44, 44))
        );

        pannelDestop.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        imageViewer.setMinimumSize(new java.awt.Dimension(852, 650));

        javax.swing.GroupLayout imageViewerLayout = new javax.swing.GroupLayout(imageViewer);
        imageViewer.setLayout(imageViewerLayout);
        imageViewerLayout.setHorizontalGroup(
            imageViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 852, Short.MAX_VALUE)
        );
        imageViewerLayout.setVerticalGroup(
            imageViewerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 650, Short.MAX_VALUE)
        );

        imageViewer.setBounds(0, 0, 852, 650);
        pannelDestop.add(imageViewer, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(PannelTab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(pannelDestop, javax.swing.GroupLayout.PREFERRED_SIZE, 852, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(PannelTab, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pannelDestop, javax.swing.GroupLayout.DEFAULT_SIZE, 539, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btDangNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDangNhapActionPerformed
        // TODO add your handling code here:
//        formDangNhap form;
//        form = new formDangNhap();
//        form.setVisible(true);      
//        menu.setEnabled(false);
    }//GEN-LAST:event_btDangNhapActionPerformed

    private void btNghiepVuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNghiepVuActionPerformed
        // TODO add your handling code here:

        FrameQuanLy quanLy = new FrameQuanLy();
        quanLy.setVisible(true);
        quanLy.setResizable(false);
        quanLy.setLocationRelativeTo(pannelDestop);
        menu.setEnabled(false);



    }//GEN-LAST:event_btNghiepVuActionPerformed

    private void btTimKiemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTimKiemActionPerformed
        try {
            // TODO add your handling code here:
            FrameTimKiem timKiem = new FrameTimKiem();
            timKiem.setVisible(true);
            timKiem.setResizable(false);
            timKiem.setLocationRelativeTo(pannelDestop);
            menu.setEnabled(false);


        } catch (Exception ex) {
            Logger.getLogger(FrameMenu.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_btTimKiemActionPerformed

    private void btChatLuongActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btChatLuongActionPerformed
        // TODO add your handling code here:
        FrameChucNang chucNang = new FrameChucNang();
        chucNang.setVisible(true);
        chucNang.setResizable(false);
        chucNang.setLocationRelativeTo(pannelDestop);
        menu.setEnabled(false);


    }//GEN-LAST:event_btChatLuongActionPerformed

    private void btThongTinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btThongTinActionPerformed
        // TODO add your handling code here:
        Thongtin t = new Thongtin();
        t.setVisible(true);
        t.setResizable(false);
        t.setLocationRelativeTo(pannelDestop);
        menu.setEnabled(false);
    }//GEN-LAST:event_btThongTinActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrameMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrameMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrameMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrameMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                menu = new FrameMenu();
                menu.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel PannelTab;
    private javax.swing.JButton btChatLuong;
    private javax.swing.JButton btDangNhap;
    private javax.swing.JButton btNghiepVu;
    private javax.swing.JButton btThongTin;
    private javax.swing.JButton btTimKiem;
    private org.jdesktop.swingx.JXImageView imageViewer;
    public javax.swing.JDesktopPane pannelDestop;
    // End of variables declaration//GEN-END:variables
}
